feat: add Excimer auto-sampling profiler with flamegraph dashboard#4
Conversation
Agent-Logs-Url: https://github.com/PHPDevsr/php-profiler/sessions/071177e1-7af4-4040-92bc-ad0a180b3efb Co-authored-by: ddevsr <97607754+ddevsr@users.noreply.github.com>
…t filename, count validation) Agent-Logs-Url: https://github.com/PHPDevsr/php-profiler/sessions/071177e1-7af4-4040-92bc-ad0a180b3efb Co-authored-by: ddevsr <97607754+ddevsr@users.noreply.github.com>
|
@copilot fix all functional PHP Unit |
Agent-Logs-Url: https://github.com/PHPDevsr/php-profiler/sessions/19e82ae3-7ad7-4e95-aa5b-b5581b73f268 Co-authored-by: ddevsr <97607754+ddevsr@users.noreply.github.com>
Fixed in commit
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot fix PHPStan |
…eTest Agent-Logs-Url: https://github.com/PHPDevsr/php-profiler/sessions/ba342eb1-f3bd-47c9-9374-2b07ab63be83 Co-authored-by: ddevsr <97607754+ddevsr@users.noreply.github.com>
Fixed in commit
|
|
@copilot fix PHPUnit why |
Agent-Logs-Url: https://github.com/PHPDevsr/php-profiler/sessions/5ade9e2b-bbee-4df1-946c-0faf79b66be2 Co-authored-by: ddevsr <97607754+ddevsr@users.noreply.github.com>
Fixed in commit The PHP 8.3 CI runner installs Changes:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Summary
Adds end-to-end automatic PHP request profiling using the Excimer extension, a standalone auto-prepend entry point, and a self-contained flamegraph dashboard.
Setup (two steps)
1.
php.iniauto_prepend_file = /opt/php-profiler/profiler.php2. Web server – secure the dashboard (Nginx example)
Then open
http://127.0.0.1/profiler/after making some requests.Changes
New files
profiler.phpauto_prepend_file– starts anExcimerProfileron every HTTP request and saves a JSON profile todata/on shutdown. No autoloader needed. SanitizesREQUEST_URI, excludes the dashboard path, and prunes the oldest files when > 10 000 profiles accumulate.dashboard/index.php?action=endpoints,?action=profiles,?action=export) and a full HTML page with a pure-JS SVG flamegraph renderer (no CDN dependencies).src/Storage/FileStorage.phpstubs/ExcimerProfiler.phpExcimerProfilerC-extension class.stubs/ExcimerLog.phpExcimerLog.stubs/ExcimerLogEntry.phpExcimerLogEntry.tests/Storage/FileStorageTest.phpFileStorage(save, findAll, findByEndpoint, getEndpointStats, cleanup).Modified files
src/Profiler.phpgetFoldedStacks()method; addsparseFoldedStacks()private helper with positive-integer count validation.tests/ProfilerTest.phpgetFoldedStacks(), updatedreset()behaviour, and start/stop lifecycle.phpstan.neon.diststubFilesentries for the three Excimer stubs (required for level-9 analysis).README.mdDashboard features
.jsonfile